﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ManagmentHeader.aspx.cs" Inherits="ElectronicJournal.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
      <asp:SqlDataSource ID="SqlDataSourceHeaderImage" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT * FROM Image_Header"
        UpdateCommand="UPDATE Image_Header SET Views = @views, Name = @name WHERE id_header_image = @id_header_image"
       InsertCommand="INSERT INTO Image_Header (Views, Name) VALUES (@views, @name)">
        <InsertParameters>
            <asp:Parameter Name="views" Type="Int32" />
            <asp:Parameter Name="name" Type="String" />
    
        </InsertParameters>
    </asp:SqlDataSource>
                  <div  id="UsersRolesPanel">
                    <asp:GridView ID="UsersInRolesGridView" runat="server" 
                    DataSourceID="SqlDataSourceHeaderImage" AutoGenerateColumns="False" CellPadding="1" 
                        CellSpacing="1" DataKeyNames="id_header_image">
                     

                        <FooterStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        <Columns>

                            <asp:BoundField DataField="Views" SortExpression="Views" HeaderText="Отображать"/>
                            <asp:BoundField DataField="Name" SortExpression="Name" HeaderText="Имя файла" />

                            <asp:CommandField ShowEditButton="true" EditText="Изменить" UpdateText="Применить" CancelText="Отмена" />
                        </Columns>
                    </asp:GridView>



        <asp:FileUpload ID="FileUpload1" runat="server"  />
      
    
        <asp:Button id="UploadBtn" 
            Text="Загрузить"
            OnClick="UploadBtn_Click"
            runat="server">
        </asp:Button>    

        <asp:Label id="UploadStatusLabel"
            runat="server">
        </asp:Label>   



</asp:Content>
